import React,{useState,useEffect} from 'react'
import {NavLink as Link, withRouter} from "react-router-dom";
import { NavBar } from 'antd-mobile';
function Navr(props) {
    // console.log(111111,props);
    const [flag, setFlag] = useState(true);
    useEffect(()=>{
        console.log(props.location.pathname);
        if( 
        props.location.pathname == "/" ||
        // props.location.pathname == "/VIP" ||
        props.location.pathname == "/healthy" ||
        props.location.pathname == "/mine" ||
        props.location.pathname == "/country"
        ){
            setFlag(false);  
        }else{
            setFlag(true);
        }
    },[props.location.pathname]);
    const back = () => {
        window.history.back(-1);
     };
  return (
    <>
    {flag ? (
      <>
         <NavBar onBack={back}></NavBar>
      </>
    ) : null}
  </>
   
  );
}

export default withRouter(Navr)